public class Demo1 {
    public static void main(String[] args) {
        Thread t = new Thread(()->{
            while (true){
                System.out.println("thread");
                try {
                    Thread.sleep(1000);
                }catch (InterruptedException e){
                    throw new RuntimeException(e);
                }
            }
        },"自定义线程");//此时的线程有一个名字 不是用Thread来命名的
        t.start();//main线程就被销毁了
    }
}
